package com.supermap.business.product;

import com.alibaba.dubbo.config.annotation.Reference;
import com.supermap.dataservice.util.JSONUtil;
import com.supermap.dataservice.util.JSONUtils;
import com.supermap.dubbo.api.cloud.suggest.SuggestService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author:zhoujian
 * @Desciption:
 * @date:2019-04-08 16:42
 * @version:v1.0.0
 */
@RestController
@RequestMapping("expert")
public class ExpertProductController {

    @Reference(timeout = 100000)
    SuggestService suggestService;

    @GetMapping("getProductListByUserId")
    public JSONUtils selectSuggestByUserId(@RequestParam(value = "userId") String userId ,
                                           @RequestParam(value="type") Integer type,
                                           @RequestParam(value="pageNum") Integer pageNum ,
                                           @RequestParam(value="pageSize") Integer pageSize)
    {
        return  suggestService.getProductListByUserId(userId,type,pageNum,pageSize);
    }
    @GetMapping("getProductDetails")
    public JSONUtils getSuggestDetails(@RequestParam(value = "productId") Integer productId)
    {
        return  suggestService.getProductDetails(productId);
    }
}